import path from 'path'
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import {dependencies} from './package.json'
import {fileURLToPath, URL} from 'node:url'
// https://vite.dev/config/
export default defineConfig({
  plugins: [vue()],
  resolve:{
    alias:{
      '@': fileURLToPath(new URL('./src', import.meta.url)),
    },
    extensions: ['.js', '.ts', '.jsx', '.tsx', '.json', '.vue'],
  },
  server:{
    host:true,
    port:5147,
    strictPort:true,
    open:true,
    proxy:{
      '/dev-api':{
        target: 'http://192.168.11.237:8080',
        changeOrigin:true,
        rewrite:(p)=>p.replace(/^\/dev-api/, '')
      }
    },
  },
})